package com.example.controller;

import com.example.entity.Teacher;
import com.example.service.IDriverService;
import com.example.service.ITeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 教师表 前端控制器
 * </p>
 *
 * @author Lin&xwj
 * @since 2025-11-07
 */

@CrossOrigin(origins = "http://localhost:8080", methods = {RequestMethod.GET, RequestMethod.POST})
@RestController
@RequestMapping("/example/teacher")
public class TeacherController {
    @Autowired
    ITeacherService teacherService;

    @Autowired
    IDriverService driverService;

    @GetMapping("/get")
    public List<Teacher> getTeacher(){

        return teacherService.list();
    }
    @PatchMapping
    public String addTeacher(@RequestBody SecurityProperties.User user){
        return "success";}

}
